﻿public class Solution78
{

    IList<IList<int>> res;
    public IList<IList<int>> Subsets(int[] nums)
    {
         res = new List<IList<int>>();
        IList<int> path = new List<int>();
        DFS(path, nums, 0);
        return res;



    }

    public void DFS(IList<int> path, int[] nums, int start)
    {



        for (int i = start; i < nums.Length; i++)
        {
            
            path.Add(nums[i]);
            res.Add(new List<int>(path));
            DFS(path, nums, i + 1);
            path.RemoveAt(path.Count - 1);


        }



    }
}

class Program78
{





    static void Main78(string[] args)
    {


        Solution78 solution = new Solution78();



        int[] nums = [1, 2, 3];
        IList<IList<int>> res=  solution.Subsets(nums);

        for(int i = 0; i < res.Count; i++)
        {
            for(int j = 0; j < res[i].Count; j++)
            {
                Console.Write(res[i][j]+",");

            }
            Console.WriteLine();


        }

    }
}